#include "property.hh"
#include "../network/parameter.hh"

namespace kratos {
namespace grid {

Property::Property() {
    leaderAddress.clear();
    localAddress.clear();
    joinTimeout = JoinTimeoutDefault;
    pingTimeout = PingTimeoutDefault;
    closePing = false;
    isLeader = false;
    isRouter = false;
    domain = 0;
    host = 0;
    type = 0;
    gatewaySessionTimeout = SessionTimeoutDefault;
    maxHop = MaxHopDefault;
    findType = PathFindType::RoundRobin;
    siteDupPolicy = SiteDupPolicy::KeepOld;
    joinBroadcast = true;
    loopService = false;
    bufSize = GIRD_SESSION_DEFAULT_BUFFER_SIZE;
}

Property::~Property() {
    clear();
}

void Property::clear() {
    leaderAddress.clear();
    localAddress.clear();
    joinTimeout = 0;
    isLeader = false;
    closePing = false;
    domain = 0;
    host = 0;
    type = 0;
    joinTimeout = 0;
    gatewaySessionTimeout = 0;
    isRouter = false;
    maxHop = 0;
    findType = PathFindType::None;
    siteDupPolicy = SiteDupPolicy::None;
    joinBroadcast = false;
    loopService = false;
    bufSize = 0;
}

}
}
